<template>
  <div>
    <button @click="isshow = !isshow">显示隐藏</button>
    <!-- <h1 v-show="isshow" class="come">123456789</h1> -->
    <transition name="hello" appear>
      <!-- 一上来加载 -->
      <h1 v-show="isshow">123456789</h1>
    </transition>
  </div>
</template>

<script>
export default {
  name: "test",
  data() {
    return {
      isshow: true,
    };
  },
};
</script>

<style scoped>
h1 {
  background-color: skyblue;
}
.hello-enter-active {
  animation: gyl 1s linear;
}
.hello-leave-active {
  animation: gyl 1s linear reverse;
}
@keyframes gyl {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(0);
  }
}
</style>>